package com.lhy.ltss.dao;

import org.apache.ibatis.annotations.*;

/**
 * @description:
 * @author: 李汇远
 */
@Mapper
public interface FindDao {
    // 匹配找书员，
    @Select("select username from user where role='finder' and username not in (select username from find) " +
            "union (select username from find GROUP BY username order by count(order_detail))")
    String getFinder();

    // 添加找书信息
    @Insert("insert into find(order_detail,username) values(#{detail},#{username})")
    Integer add(@Param("detail") Integer detail, @Param("username") String username);

    // 删除找书信息
    @Delete("delete from find where order_detail=#{id}")
    Integer remove(Integer id);
}
